From 16fdf9e216342dbbb41e478b17df71337b2f6f32 Mon Sep 17 00:00:00 2001 From: robertl Date: Wed, 27 Jul 2005 21:39:09 +0000 Subject: [PATCH] Tobias Minich contributes the 'coto' format. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@1319 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/Makefile | 2 +- gpsbabel/README | 26 +++++++++++++++++++++++++- gpsbabel/coto.c | 4 ++++ gpsbabel/testo | 25 +++++++++++++++++++++++++ gpsbabel/vecs.c | 7 +++++++ 5 files changed, 62 insertions(+), 2 deletions(-) diff --git a/gpsbabel/Makefile b/gpsbabel/Makefile index 60c1e494e..ea49b19c6 100644 --- a/gpsbabel/Makefile +++ b/gpsbabel/Makefile @@ -36,7 +36,7 @@ FMTS=magproto.o gpx.o geo.o mapsend.o mapsource.o garmin_tables.o \ ozi.o nmea.o text.o html.o palmdoc.o netstumbler.o hsa_ndv.o \ igc.o brauniger_iq.o shape.o hiketech.o glogbook.o coastexp.o \ vcf.o overlay.o kml.o google.o lowranceusr.o an1.o tomtom.o \ - tef_xml.o maggeo.o pathaway.o vitosmt.o gdb.o bcr.o + tef_xml.o maggeo.o pathaway.o vitosmt.o gdb.o bcr.o coto.o FILTERS=position.o duplicate.o arcdist.o polygon.o smplrout.o reverse_route.o sort.o stackfilter.o trackfilter.o dopfilt.o diff --git a/gpsbabel/README b/gpsbabel/README index 1e6ac1a13..12de958f7 100644 --- a/gpsbabel/README +++ b/gpsbabel/README @@ -913,13 +913,37 @@ THE FORMATS -F a_to_b.bcr OPENOFFICE - Tab seperated export-all (except geocahing data) file format. + Tab seperated export-all (except geocaching data) file format. Intended to serve as source for number-processing applications like OpenOffice, Ploticus and others. Tab was chosen as delimiter because it is a) supported by both OpenOffice and Ploticus and b) is not ',', so you can use 'sed -i "s/./,/g" .csv' to adapt it to locales where ',' is used as decimal seperator. Contributed by Tobias Minich. + + COTO + Format for cotoGPS, a Palm GPS program. It can read both + track and marker (waypoint) files. It is currently unable + to write track files, so only marker files can be written. The + marker categories are written to and read from the icon + description. The 'Not Assigned' category leaves the icon + description empty on read. Currently geocache info is ignored. + + Options: + + trackname (input) - Name for the track. Defaults to + the pdb name or file name if the pdb name is the default + ('cotoGPS TrackDB'). This is currently (Coto Version 1.3.1) + always the case. + zerocat (output) - Name for the Palm 'Not Assigned' category. + Defaults to 'Not Assigned'. + There is also a debugging option called 'internals' which + takes a XCSV delimiter value. It writes some internal + values (distance, arc, x and y) of the cotoGPS track + format to the notes field. + + URL: http://core.de/~coto/projects/cotogps/ + Contributed by Tobias Minich. DATA FILTERS diff --git a/gpsbabel/coto.c b/gpsbabel/coto.c index 933cbc22f..139c7ad4a 100644 --- a/gpsbabel/coto.c +++ b/gpsbabel/coto.c @@ -322,9 +322,13 @@ coto_wpt_write(const waypoint *wpt) setshort_whitespace_ok(mkshort_wr_handle, 1); if ((global_opts.synthesize_shortnames && wpt->description) || (!wpt->shortname)) { +#if 0 if (wpt->shortname) xfree(wpt->shortname); wpt->shortname = mkshort_from_wpt(mkshort_wr_handle, wpt); +#else +abort(); +#endif } if ((wpt->description) && ((strlen(wpt->description) > MAX_MARKER_NAME_LENGTH) || (strcmp(wpt->description, wpt->shortname)))) { if ((wpt->notes) && (strcmp(wpt->description, wpt->notes))) { diff --git a/gpsbabel/testo b/gpsbabel/testo index 9c6f1547d..98ddb611a 100755 --- a/gpsbabel/testo +++ b/gpsbabel/testo @@ -764,4 +764,29 @@ ${PNAME} -i glogbook -f reference/track/garmin_logbook.xml -o glogbook -F ${TMPD ${PNAME} -i glogbook -f ${TMPDIR}/glog.xml -o gpx -F ${TMPDIR}/glog2.gpx compare ${TMPDIR}/glog1.gpx ${TMPDIR}/glog2.gpx +# +# Dop filter test +# +rm -f ${TMPDIR}/dop* +sed '/50/d' reference/dop-test.gpx | ${PNAME} -i gpx -f - -o openoffice -F - | sed 's/RPT...//g' > ${TMPDIR}/dop-hdop.ref +${PNAME} -i gpx -f reference/dop-test.gpx -x dop,hdop=50 -o openoffice -F - | sed 's/RPT...//g' > ${TMPDIR}/dop-hdop.fil +compare ${TMPDIR}/dop-hdop.ref ${TMPDIR}/dop-hdop.fil +sed '/50/d' reference/dop-test.gpx | ${PNAME} -i gpx -f - -o openoffice -F - | sed 's/RPT...//g' > ${TMPDIR}/dop-vdop.ref +${PNAME} -i gpx -f reference/dop-test.gpx -x dop,vdop=50 -o openoffice -F - | sed 's/RPT...//g' > ${TMPDIR}/dop-vdop.fil +compare ${TMPDIR}/dop-vdop.ref ${TMPDIR}/dop-vdop.fil + +# +# cotoGPS test +# +rm -f ${TMPDIR}/coto* +# Track reading +${PNAME} -i coto -f reference/cototesttrack.pdb -o openoffice -F ${TMPDIR}/cototrack.csv +compare reference/cototesttrack.csv ${TMPDIR}/cototrack.csv +# Marker read/write +${PNAME} -i coto -f reference/cototestmarker.pdb -o openoffice -F ${TMPDIR}/cotomarker.csv +${PNAME} -i gpx -f reference/cototestmarker.gpx -o openoffice -F ${TMPDIR}/cotomarkergpx.csv +compare ${TMPDIR}/cotomarker.csv ${TMPDIR}/cotomarkergpx.csv +${PNAME} -i gpx -f reference/cototestmarker.gpx -o coto -F ${TMPDIR}/cotomarker.pdb +compare reference/cototestmarker.pdb ${TMPDIR}/cotomarker.pdb + exit 0 diff --git a/gpsbabel/vecs.c b/gpsbabel/vecs.c index 831b00ebd..fd73811e1 100644 --- a/gpsbabel/vecs.c +++ b/gpsbabel/vecs.c @@ -85,6 +85,7 @@ extern ff_vecs_t ppdb_vecs; extern ff_vecs_t vitosmt_vecs; extern ff_vecs_t gdb_vecs; extern ff_vecs_t bcr_vecs; +extern ff_vecs_t coto_vecs; static vecs_t vec_list[] = { @@ -419,6 +420,12 @@ vecs_t vec_list[] = { "Motorrad Routenplaner (Map&Guide) .bcr files", "bcr" }, + { + &coto_vecs, + "coto", + "cotoGPS for PalmOS", + NULL + }, { NULL, NULL, -- 2.30.2